package com.godpaper.as9.commands
{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.godpaper.as9.bussiness.delegates.GradeDelegate;
	import com.godpaper.as9.events.SetGradeInfoEvent;
	
	import mx.rpc.IResponder;

	public class SetGradeInfoCommand extends CommandBase implements ICommand, IResponder
	{
		private var delegate:GradeDelegate;
		private var setGradeInfoEvent:SetGradeInfoEvent;
		public function SetGradeInfoCommand()
		{
			super();
			delegate = new GradeDelegate(this);
		}
		
		override public function execute(event:CairngormEvent):void
		{
			setGradeInfoEvent = SetGradeInfoEvent(event);
			delegate.create(setGradeInfoEvent.gradeInfo);
		}
		
		override public function result(data:Object):void
		{
			if(data.hasOwnProperty("result"))
			{
				if(data.result.info=="success")
				{
					trace(data.result.detail);
				};
			}
			
		}
		
	}
}